<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');

/**
 * SimplyPost
 *
 * @author		Pascal Kriete
 * @package		SimplyPost
 * @copyright	Copyright (c) 2008, Pascal Kriete
 * @license 	http://www.gnu.org/licenses/lgpl.txt
 */

// ------------------------------------------------------------------------

/**
 * Member Controller
 *
 * @package		SimplyPost
 * @subpackage	Member
 * @category	Controller
 * @author		Pascal Kriete
 */

class Member extends Authenticated {

	/**
	 * Controller
	 *
	 * @access	public
	 */
	function Member()
	{
		parent::Authenticated();
		$this->lang->load('member');
	}
	
	// ------------------------------------------------------------------------
	
	/**
	 * Show Member List
	 *
	 * @access	public
	 */
	function index()
	{
		set_title($this->lang->line('member_list_title'));
		$this->breadcrumb->custom(array('Member List'));
		
		$this->load->model('User_model','User');
		$data['users'] = $this->User->get_all();

		$this->parser->parse('member/list', $data);
	}
	
	// ------------------------------------------------------------------------
	
	/**
	 * Logout current user
	 *
	 * @access	public
	 */
	function logout()
	{
		$this->load->library('auth');
		
		$this->auth->logout();
		$this->session->set_flashdata('msg', $this->lang->line('logout_success'));
		redirect('');
	}
}